#ifndef COEFFICIENT_H
#define COEFFICIENT_H

#include <string>

using namespace std;

/** This class is used to store and manipulate a linear equation.
 * In some way, the idea of this class is to isolate the type begin used
 * in order to be able to change for example from double to long double
 * or rational numbers, as needed, without dependency on the rest of the
 * system.
 */
class Coefficient {
 public:
  /** This method reads a coefficient from a string.
   */
  static Coefficient ReadCoefficientFromString(const string);
  /** This method just gives an instance of Coefficient with 0 value. */
  static Coefficient ZeroInstance();
  /** This method just gives an instance of Coefficient with value 1. */
  static Coefficient OneInstance();

  /** This method tell if the value of the Coefficient is zero. */
  bool NonZeroCoefficient();
  /** Operator + overload. */
  Coefficient operator+(const Coefficient &);
  /** Operator - overload. */
  Coefficient operator-(const Coefficient &);
  /** Operator / overload. */
  Coefficient operator/(const Coefficient &);
  /** Operator * overload. */
  Coefficient operator*(const Coefficient &);

  /** This method just prints the oefficient. */
  void PrintCoefficientToStdout();

 private:
  Coefficient() {}
  Coefficient(double  coefficient) : coefficient_(coefficient) {}

  double coefficient_;
};

#endif  // COEFFICIENT_H
